/**
 * websocket创建
 */
export function websocket(ip,token) {
  return new Promise((res, req) => {
    if ('WebSocket' in window) {
      const ws = new WebSocket(`${'ws://' + ip + '/genecloud/ws/message'}`,[token])
      res(ws)
    } else {
      req('您的浏览器不支持 WebSocket!')
    }
  })
}